#include <stdio.h>
#include <string.h>
#define N 256

int main() {
	char c1[N] = { 0 }, c2[N] = { 0 }, ex[N] = { 0 };
	scanf("%s", c1);
	scanf("%s", c2);
	int i,index, len = strlen(c1);
	scanf("%d", &index);
	for (i = index; i < len; i++) ex[i - index] = c1[i];
	c1[index] = '\0';

	strcat(c1, c2);
	strcat(c1, ex);

	printf("%s", c1);

	return 0;
}